(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/index/index" ], {
    "260c": function(t, e, n) {
        n.r(e);
        var a, r = n("8a29"), o = n("5d8f");
        for (a in o) "default" !== a && function(t) {
            n.d(e, t, function() {
                return o[t];
            });
        }(a);
        n("b68d");
        var i = n("f0c5"), s = Object(i.a)(o.default, r.b, r.c, !1, null, null, null, !1, r.a, void 0);
        e.default = s.exports;
    },
    "4b67": function(t, e, n) {},
    "5d8f": function(t, e, n) {
        n.r(e);
        var a, r = n("7ca1"), o = n.n(r);
        for (a in r) "default" !== a && function(t) {
            n.d(e, t, function() {
                return r[t];
            });
        }(a);
        e.default = o.a;
    },
    "7ca1": function(t, n, r) {
        (function(a) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var t, o = (t = r("4795")) && t.__esModule ? t : {
                default: t
            };
            function c(t, e, n, a, r, o, i) {
                try {
                    var s = t[o](i), c = s.value;
                } catch (t) {
                    return n(t), 0;
                }
                s.done ? e(c) : Promise.resolve(c).then(a, r);
            }
            function i(s) {
                return function() {
                    var t = this, i = arguments;
                    return new Promise(function(e, n) {
                        var a = s.apply(t, i);
                        function r(t) {
                            c(a, e, n, r, o, "next", t);
                        }
                        function o(t) {
                            c(a, e, n, r, o, "throw", t);
                        }
                        r(void 0);
                    });
                };
            }
            var e = {
                data: function() {
                    return {
                        isShow: null,
                        system: {},
                        is_adver: "",
                        pic_url: this.$imgUrl,
                        latitude: "",
                        longitude: "",
                        covers: [],
                        scale: 15,
                        swiperItems: [],
                        recycleList: [],
                        categoryList: [],
                        categoryList3: [],
                        templateFour: {},
                        userInfo: {},
                        id: "",
                        options: {},
                        nearbyIndex: 1,
                        mapHeight: "1000",
                        tabIndex: 0,
                        indicatorDots: !0,
                        autoplay: !0,
                        interval: 4e3,
                        duration: 500,
                        companyList: [],
                        noticeList: [],
                        isTransaction: !1,
                        contentText: ""
                    };
                },
                onLoad: function(t) {
                    var e = this;
                    console.log("======", this.$api, this.$imgUrl), this.options = t, this.tabIndex = t.index, 
                    this.recycleReq(),this.indexCateRecommend(), this.collectorAndPackLists(), this.$nextTick(function() {
                        a.getSystemInfo({
                            success: function(t) {
                                e.mapHeight = 2 * (t.windowHeight - 252 + t.statusBarHeight);
                            }
                        });
                    });
                },
                onShow: function() {
                    this.systems(), this.getPluginList(), this.user(), this.getLocation(), this.getCompany(), 
                    this.getNotice(), this.options.scene && a.setStorageSync("pid", this.options.scene);
                },
                onShareAppMessage: function() {
                    return {
                        path: "wjyk_recycle/pages/index/index",
                        title: a.getStorageSync("share_title"),
                        imageUrl: a.getStorageSync("share_pic")
                    };
                },
                onShareTimeline: function() {
                    return {
                        title: a.getStorageSync("share_title"),
                        imageUrl: a.getStorageSync("share_pic")
                    };
                },
                onUnload: function() {
                    a.setStorageSync("isShow", !1);
                },
                methods: {
                    changeUrl: function(t, e) {
                        console.log("*********************", t, e, e.appid), 1 == e.type && a.navigateTo({
                            url: e.url
                        }), 2 == e.type && "" != e.appid && null != e.appid && wx.navigateToMiniProgram({
                            appId: e.appid,
                            success: function(t) {
                                console.log("成功", t);
                            },
                            fail: function(t) {
                                console.log("失败", t);
                            }
                        });
                    },
                    getLocation: function() {
                        var n = this;
                        wx.getLocation({
                            success: function(t) {
                                var e;
                                n.latitude = t.latitude, n.longitude = t.longitude, wx.getSetting({
                                    success: (e = i(o.default.mark(function t(e) {
                                        return o.default.wrap(function(t) {
                                            for (;;) switch (t.prev = t.next) {
                                              case 0:
                                                e.authSetting["scope.userLocation"] ? (n.init(), n.$refs.pop2.close()) : n.$refs.pop2.show({
                                                    title: "提示",
                                                    topclose: !1,
                                                    shadeClose: !1,
                                                    titleStyle: "font-weight:bold;text-align:left;",
                                                    style: "background-color:#fff;width:680rpx;"
                                                });

                                              case 1:
                                              case "end":
                                                return t.stop();
                                            }
                                        }, t);
                                    })), function(t) {
                                        return e.apply(this, arguments);
                                    })
                                });
                            },
                            fail: function(t) {
                                n.$refs.pop2.show({
                                    title: "提示",
                                    topcloseright: !0,
                                    shadeClose: !1,
                                    titleStyle: "font-weight:bold;text-align:left;",
                                    style: "background-color:#fff;width:680rpx;"
                                });
                            }
                        });
                    },
                    close: function() {
                        this.$refs.pop.close();
                    },
                    openProtocol: function() {
                        this.$refs.pop.show({
                            content: "<div>&nbsp;</div>",
                            style: "background-color:#fff;width:440rpx;height:560rpx;border-radius:10rpx;",
                            xclose: !0
                        });
                    },
                    xOpen: function(t) {
                        this.contentText = t, this.$refs.pop3.show({
                            style: "background-color:#fff;width:600rpx;height:700rpx;border-radius:10rpx;",
                            xclose: !0
                        });
                    },
                    more: function() {
                        a.navigateTo({
                            url: "/wjyk_recycle/pages/index/more/more"
                        });
                    },
                    getNotice: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.notice
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.noticeList = e.data);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getCompany: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.company,
                                        data: {
                                            page: 1,
                                            psize: 5
                                        }
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.companyList = e.data.list);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    user: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.user,
                                        data: {
                                            uid: a.getStorageSync("uid")
                                        }
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.userInfo = e.data);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getPluginList: function() {
                        var r = this;
                        return i(o.default.mark(function t() {
                            var e, n, a;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, r.$http({
                                        url: r.$api.pluginList
                                    });

                                  case 2:
                                    if (0 == (e = t.sent).errno) for (n = e.data, a = 0; a < n.length; a++) "wjyk_recycle_plugin_transactions" == n[a].identifie && 2 == n[a].is_open && (r.isTransaction = !0);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    transaction: function() {
                        this.isTransaction ? a.getStorageSync("uid") ? a.switchTab({
                            url: "/wjyk_recycle/pages/transaction/index/index"
                        }) : a.navigateTo({
                            url: "../auth/auth"
                        }) : this.$sun.toast("二手交易暂未开放!");
                    },
                    quicklyOrder: function() {
                        2 != this.system.order_open ? a.getStorageSync("uid") ? a.navigateTo({
                            url: "../order-now/order-now"
                        }) : a.navigateTo({
                            url: "../auth/auth"
                        }) : this.$sun.toast("该区域暂停下单");
                    },
                    shop: function() {
                        1 == this.templateFour.exchange_open ? a.navigateTo({
                            url: "/wjyk_recycle/pages/exchange-mall/exchange-mall?index=1"
                        }) : this.$sun.toast("兑换商城暂未开放!");
                    },
                    shareMoney: function() {
                        1 == this.templateFour.promote_open ? a.getStorageSync("uid") ? a.navigateTo({
                            url: "../share-money/share-money"
                        }) : a.navigateTo({
                            url: "../auth/auth"
                        }) : this.$sun.toast("推广中心暂未开放!");
                    },
                    cityPartner: function() {
                        1 == this.templateFour.partner_open ? a.getStorageSync("uid") ? (1 == this.userInfo.partnerstatus && a.navigateTo({
                            url: "../apply-settle/apply-settle?name=partner"
                        }), 2 == this.userInfo.partnerstatus && (2 == this.userInfo.partnerfreeze ? this.$sun.toast("该合伙人已冻结，请联系管理员") : a.navigateTo({
                            url: "../city-partner-center/city-partner-center?partnerid=" + this.userInfo.partnerid
                        })), "" == this.userInfo.partnerstatus && a.navigateTo({
                            url: "../city-partner/city-partner"
                        })) : a.navigateTo({
                            url: "../auth/auth"
                        }) : this.$sun.toast("城市合伙人暂未开放!");
                    },
                    systems: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.system
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (e.data.name ? (a.setStorageSync("title", e.data.name), 
                                    n.$sun.title(e.data.name)) : (a.setStorageSync("title", "首页"), n.$sun.title("首页")), 
                                    console.log("系统设置", e, e.data.name), n.system = e.data, n.is_adver = e.data.is_adver, 
                                    n.isShow = e.data.template, a.setStorageSync("share_pic", e.data.share_pic), a.setStorageSync("share_title", e.data.share_title), 
                                    a.setStorageSync("name", e.data.recycle), a.setStorageSync("unit", e.data.unit), 
                                    a.setStorageSync("key", e.data.key), a.getStorageSync("isShow"), 1 == e.data.is_adver && n.openProtocol(), 
                                    3 == e.data.template ? n.indexCateRecommend() : (n.getIndexTemplateFour(), n.indexCate()), 
                                    wx.showShareMenu({
                                        withShareTicket: !0,
                                        menus: [ "shareAppMessage", "shareTimeline" ]
                                    }));

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getIndexTemplateFour: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.indexTemplateFour
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.templateFour = e.data, console.log("模板四：", e));

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    recycleReq: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.recycleReq
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.recycleList = e.data, console.log("首页回收要求", e));

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    indexCate: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.indexCate
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.categoryList = e.data, console.log("首页分类展示", e));

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    indexCateRecommend: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.indexCateRecommend
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.categoryList3 = e.data, console.log("首页推荐分类展示（模板3）", e));

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    collectorAndPackLists: function() {
                        var r = this;
                        return i(o.default.mark(function t() {
                            var e, n, a;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, r.$http({
                                        url: r.$api.collectorAndPackList
                                    });

                                  case 2:
                                    if (e = t.sent, console.log("首页回收员回收站列表", e), 0 == e.errno) for (n = 0; n < e.data.length; n++) a = {
                                        latitude: e.data[n].lat,
                                        longitude: e.data[n].lng,
                                        iconPath: 1 == e.data[n].flag ? r.$imgUrl + "/address-icon@3x.png" : r.$imgUrl + "/pack.png",
                                        width: 40,
                                        height: 40,
                                        callout: {
                                            content: e.data[n].name,
                                            color: "#FFFFFF",
                                            fontSize: 10,
                                            borderRadius: 5,
                                            bgColor: "#3FCB25",
                                            display: "ALWAYS",
                                            padding: 6,
                                            textAlign: "center"
                                        }
                                    }, r.covers.push(a);

                                  case 5:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    init: function() {
                        var n = this;
                        return i(o.default.mark(function t() {
                            var e;
                            return o.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$sun.latlng();

                                  case 2:
                                    e = t.sent, console.log("map", e), n.latitude = e.lat, n.longitude = e.lng;

                                  case 6:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    }
                }
            };
            n.default = e;
        }).call(this, r("543d").default);
    },
    "8a29": function(t, e, n) {
        function a() {
            this.$createElement, this._self._c;
        }
        var r = {
            sunuiPopup: function() {
                return n.e("components/sunui-popup/sunui-popup").then(n.bind(null, "c2fe"));
            },
            richParser: function() {
                return Promise.all([ n.e("common/vendor"), n.e("components/rich-parser/rich-parser") ]).then(n.bind(null, "02a9"));
            },
            sunuiTabbar: function() {
                return n.e("components/sunui-tabbar/sunui-tabbar").then(n.bind(null, "f6fd"));
            }
        }, o = [];
        n.d(e, "b", function() {
            return a;
        }), n.d(e, "c", function() {
            return o;
        }), n.d(e, "a", function() {
            return r;
        });
    },
    a85d: function(t, e, n) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            n("8163"), e(n("66fd")), t(e(n("260c")).default);
        }).call(this, n("543d").createPage);
    },
    b68d: function(t, e, n) {
        var a = n("4b67");
        n.n(a).a;
    }
}, [ [ "a85d", "common/runtime", "common/vendor" ] ] ]);